<link rel='stylesheet' type='text/css' href='<?php echo $this->baseUrl() . '/public/css/viewdetail.css'?>'/>
<?php $id_social_user = $this->id_social_user ?>
<div class='wrap-viewdetail'>
    <div style='padding: 10px 0px'>
        <a href='<?php echo $this->url(array("action" => "index")) ?>' class='gray-button'>
            <img src='<?php echo $this->baseUrl() . '/images/left-arrow.png'?>'/>
            Back To List
        </a>
    </div>
    <div class='wrap-general'>
        <table width='100%' cellspacing='0' cellpadding='0' class='content'>
            <tr>
                <td rowspan="2" width='50%'>
                    <div class='wrap-profile'>
                        <div class='avatar'>
                            <img src='<?php echo $this->facebook->getAvatar($id_social_user,150,150)?>' width='90px' height='90px'/>
                        </div>
                        <div class='profile'>
                            <div class='fan-name' name='fan-name'>
                            </div>
                            <div class='icon fb-link'>
                                <a href='<?php echo FACEBOOK_URL . '/' . $id_social_user ?>' target='_blank'>
                                    <?php echo FACEBOOK_URL . '/' . $id_social_user ?>
                                </a>
                            </div>
                        </div>
                    </div>
                </td>
                <td colspan="5" style='padding:10px'>
                    <div class='rank'>
                        <span>Rank: <?php echo $this->rank ?> - </span>
                        <?php if ($this->page_info['reset_period'] == 'm'): ?>
                            <span><?php echo $this->translate->_("MONTH") . ' ' . date('m', $this->start_time) . ': ' ?></span>
                        <?php endif; ?>
                        <?php if ($this->page_info['reset_period'] == 'w'): ?>
                            <span><?php echo $this->translate->_("WEEK") . ' ' . date('W', $this->start_time) . ': '?></span>
                        <?php endif; ?>      
                        <span class='info-text'>
                            <?php echo date('m/d/Y', $this->start_time) ?> -
                            <?php echo date('m/d/Y', $this->end_time) ?>
                        </span>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class='wrap-summary'>
                        <p>
                            <?php echo $this->translate->_("POSTS") ?>
                        </p>
                        <strong>
                            <?php echo $this->total_action->posts ?>
                        </strong>
                    </div>
                </td>
                <td>
                    <div class='wrap-summary'>
                        <p>
                            <?php echo $this->translate->_("COMMENTS") ?>
                        </p>
                        <strong>
                            <?php echo $this->total_action->comments ?>
                        </strong>
                    </div>
                </td>
                <td>
                    <div class='wrap-summary'>
                        <p>
                            <?php echo $this->translate->_("LIKES") ?>
                        </p>
                        <strong>
                            <?php echo $this->total_action->likes ?>
                        </strong>
                    </div>
                </td>        
                <td>
                    <div class='wrap-summary'>
                        <p>
                            <?php echo $this->translate->_("VOTES") ?>
                        </p>
                        <strong>
                            <?php echo $this->total_action->votes ?>
                        </strong>
                    </div>
                </td>                
            </tr>
        </table>
    </div>
    <div class='wrap-actions'>
        <nav class='wrap-tab'>
            <ul>
                <?php $total = $this->total_action->posts + $this->total_action->comments + 
                        $this->total_action->likes + $this->total_action->votes;
                ?>
                <li class='active' name='0'>
                    <a href='javascript:void(0)' class='mask-tab'>
                        All (<?php echo $total?>)
                    </a>
                </li>
                <li name='<?php echo POST ?>'>
                    <a href='javascript:void(0)' class='mask-tab'>
                        Posts (<?php echo $this->total_action->posts?>)
                    </a>
                </li>
                <li name='<?php echo COMMENT ?>'>
                    <a href='javascript:void(0)' class='mask-tab'>
                        Comments (<?php echo $this->total_action->comments?>)
                    </a>
                </li>
                <li name='<?php echo LIKE ?>'>
                    <a href='javascript:void(0)' class='mask-tab'>
                        Likes (<?php echo $this->total_action->likes?>)
                    </a>
                </li>
                <li style='width:18%;border-right: none' name='<?php echo VOTE ?>'>
                    <a href='javascript:void(0)' class='mask-tab'>
                        Votes (<?php echo $this->total_action->votes?>)
                    </a>
                </li>
            </ul>
        </nav>
        <div class='actions'>
            <div class='loader'>
                <img src='<?php echo $this->baseUrl() . '/images/loader.gif'?>'/>
            </div>
            <div class='display-actions'>
                <?php echo $this->partial("/_partial/action_list.phtml", 
                        array (
                            "actions"   => $this->actions,
                            "translate" => $this->translate,
                            "facebook"  => $this->facebook
                      )); 
                ?>
            </div>
        </div>
    </div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<?php $fb_params = MKT_Util::getConfig("facebook"); ?>
<?php $appId     = $fb_params['params']['appId']; ?>
<script>
    var appId           = '<?php echo $appId ?>';
    var base_url        = '<?php echo $this->baseUrl() ?>';
    var id_social_user  = '<?php echo $this->id_social_user ?>';
    var id_social_page  = '<?php echo $this->id_social_page ?>';
    var offset          = '<?php echo $this->offset?>';
</script>

<script src="//connect.facebook.net/en_US/all.js"></script>
<script>
    $(document).ready(function() {
        FB.init({
            appId: appId, 
            channelUrl: '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File for x-domain communication
            status: true, 
            cookie: true, 
            xfbml: true
        });
        FB.Canvas.setAutoGrow();
    });
    var time = <?php echo $this->start_time ?>;        
</script>

<script src='<?php echo $this->baseUrl() . '/public/javascript/viewdetail.js' ?>'></script>